package com.woniuxy.controller;

import com.woniuxy.entity.StudentCourse;
import com.woniuxy.service.StudentService;
import com.woniuxy.util.ResponseData;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @author ：CuiYC
 * @description：
 * @date ：Created in 2025/3/14 14:56
 * @modified By：
 */
@RestController
@RequestMapping("/student")
@AllArgsConstructor
public class StudentController {

    private StudentService studentService;
    @GetMapping("/queryAllCourse")
    public ResponseData<?> queryAllCourse(){
        return ResponseData.ok(studentService.queryAllCourse());
    }

    @PostMapping("/selectCourse")
    public ResponseData<?> selectCourse(@RequestBody StudentCourse studentCourse){
        return studentService.selectCourse(studentCourse);
    }

    @GetMapping("/selectStudentCourse/{studentId}")
    public ResponseData<?> selectStudentCourse(@PathVariable Integer studentId){
        return studentService.selectStudentCourse(studentId);
    }

    @PostMapping("/removeCourse")
    public ResponseData<?> removeCourse(@RequestBody StudentCourse studentCourse){
        return studentService.removeCourse(studentCourse);
    }
}
